Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@babel/runtime-corejs3
Advanced tools
babel's modular runtime helpers with core-js@3 polyfilling
The @babel/runtime-corejs3 package is a runtime library for Babel that includes polyfills for ECMAScript features using core-js version 3. It is used alongside Babel to enable the use of new JavaScript features in environments that do not natively support them. This package helps to avoid polluting the global scope and reduces the size of the compiled code by deduplicating helper functions.
Polyfilling ECMAScript features
This code imports polyfills for stable ECMAScript features and the regenerator runtime needed to use generators and async functions.
import 'core-js/stable';
import 'regenerator-runtime/runtime';
Usage of built-in methods
This code demonstrates how to use the map method from core-js through the runtime without polluting the global Array prototype.
import { map } from '@babel/runtime-corejs3/core-js-stable/instance/map';
let arr = [1, 2, 3];
let mapped = map.call(arr, x => x * x);
Usage of new syntax features
This code shows how to use the helpers provided by @babel/runtime-corejs3 to work with new syntax features like async functions and generators.
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
const asyncFunc = _asyncToGenerator(function* () {
yield Promise.resolve('Hello World');
});
core-js is a modular standard library for JavaScript, including polyfills for ECMAScript up to 2021. It's similar to @babel/runtime-corejs3 but does not require Babel to work and can be included directly in any JavaScript project.
regenerator-runtime is a standalone runtime for Regenerator-compiled generator and async functions. It is similar to the regenerator part of @babel/runtime-corejs3 but does not include other polyfills or helpers.
Deprecated in favor of separate core-js and regenerator-runtime packages, @babel/polyfill was a package that included Babel's polyfills for ECMAScript features. It was similar to @babel/runtime-corejs3 but was designed to be included globally rather than modularly.
babel's modular runtime helpers with core-js@3 polyfilling
See our website @babel/runtime-corejs3 for more information.
Using npm:
npm install --save @babel/runtime-corejs3
or using yarn:
yarn add @babel/runtime-corejs3
FAQs
babel's modular runtime helpers with core-js@3 polyfilling
We found that @babel/runtime-corejs3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.